<?php
    @header("Content-Type:text/html;charset=utf-8");

    @include_once("conn.php");   // 引入conn.php (链接mysql)
    @include_once("common.php");

     if(!isset($_POST["orderId"])){ 
        paramsErr();
    }
    $orderId = $_POST["orderId"];

    $sql = "select * from `orderlist` where orderId = '$orderId'";
    $result = mysqli_query($conn,$sql);
    $obj = array();
    if($result){ // 判断查询的结果
        $item = mysqli_fetch_assoc($result);
        if($item){
            $obj["status"] = true;
            $obj["msg"] = "success";
            $obj["data"] = $item;
            
        }else{
            $obj["status"] = false;
            $obj["msg"] = "查询的订单不存在";
            $obj["sql"] = $sql;
        }
    }else{
        $obj["status"] = false;
        $obj["msg"] = "sql语句有误";
        $obj["sql"] = $sql;
    }
    // echo 111111;submitOrders
    echo json_encode($obj);
?>